﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VAdvantage.Model;
using VAdvantage.Process; using VAdvantage.ProcessEngine;
using VAdvantage.ProcessEngine;
namespace VAdvantage.Classes
{
    public interface ASyncProcess
    {
        /// <summary>
        /// Lock User Interface.
        /// Called from the Worker before processing
        /// @param pi process info
        /// </summary>
        /// <param name="pi"></param>
        void LockUI(ProcessInfo pi);


        /// <summary>
        /// Unlock User Interface.
        /// Called from the Worker when processing is done
        /// @param pi result of execute ASync call
        /// </summary>
        /// <param name="pi"></param>
        void UnlockUI(ProcessInfo pi);


        /// <summary>
        /// Is the UI locked (Internal method)
        ///  @return true, if UI is locked
        /// </summary>
        /// <returns></returns>
        bool IsUILocked();

        /// <summary>
        /// Method to be executed async.
        /// Called from the Worker
        /// @param pi ProcessInfo
        /// </summary>
        /// <param name="pi"></param>
        void ExecuteASync(ProcessInfo pi);


    }

    /// <summary>
    /// Refresh UI
    /// </summary>
    public interface ASyncRefreshUI
    {
        void RefreshUI(ProcessInfo pi);
    }
}
